home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
C
/
Frameworks
/
Grant's CGI Framework 1.0b12
/
Util
/
DebugUtil.c
< prev
next >
Wrap
Text File
|
1995-12-09
|
1KB
|
50 lines
/*****
*
* DebugUtil.c
*
* For those of you unfamilliar with assertions,
* run - don't walk - to get a copy of "Writing Solid Code" by Steve Maguire
*
* This is a support file for "Grant's CGI Framework".
* Please see the license agreement that accompanies the distribution package
* for licensing details.
*
* Copyright ©1995 by Grant Neufeld
* grant@acm.com
* http://arpp1.carleton.ca/grant/
*
*****/
#include <ConditionalMacros.h>
#include "MyConfiguration.h"
#include "compiler_stuff.h"
#include "DebugUtil.h"
/* if the assertion (passed) fails, display the string in the debugger to alert
the developer to an unexpected problem in the code.
If an assertion ever occurs, you know that one of two things has occurred:
- something you never expected to happen in your function, happened
- you made an incorrect assumption about what state things could be in
prior to your function being called */
#if kCompileWithAssertions
void
my_assert ( Boolean passed, const StringPtr theString )
{
if ( !passed )
{
#if GENERATINGPOWERPC
DebugStr ( theString );
#else
SysBreakStr ( theString );
#endif
}
} /* my_assert */
#endif
/*** EOF ***/